The Open Shortest Path First (OSPF) protocol is an interior gateway protocol designed to distribute routing information between routers in a single autonomous system (AS). This protocol uses path cost as its routing metric, where path cost is determined generally by the speed (e.g., bandwidth) of the interface addressing a given route and where Dijkstra's algorithm is used to calculate the shortest path tree. A link state database (LSDB) is constructed as a tree structure of the network topology and identical copies of the LSDB are periodically updated on all routers in each area implementing the protocol.
OSPF routers exchange various types of link state advertisements (LSAs) to build their LSDBs. Most LSAs are flooded (sent to every router) throughout the attached area. An exception is the LSA sent out by AS boundary routers that describe routes to destinations outside the AS; these advertisements are flooded throughout the AS.
OSPF defines various types of routers. These are logical definitions though and a router that uses OSPF may be classified as more than one type. For example, consider a router that is connected to more than one area and that receives routes from a BGP (Border Gateway Protocol) process connected to another AS. As described below, such a router is both an area border router (ABR) and an autonomous system boundary router (ASBR).
An area border router (ABR) is a router that connects one or more OSPF areas to the backbone area. An ABR is considered a member of all areas to which it is connected and keeps multiple copies of LSDBs in memory, one for each area. An autonomous system boundary router (ASBR) is a router that is connected to more than one AS and that exchanges routing information with routers in other ASs. Typically, ASBRs also run a second routing protocol or routing protocol process, such as BGP. An ASBR is used to distribute routes received from other routing protocol processes throughout its own AS. A router is called an internal router (IR) if it has only OSPF adjacencies with routers in the same area.